package cn.weakup.designpattern.c_structural.proxy;

import cn.weakup.designpattern.c_structural.proxy.usepattern.RegisterBeanFactoryConfig;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author lixj
 * @version 1.0.0
 * @date 2022/6/5
 * @desc
 */
public class Test {

    public static void main(String[] args) {
        // 基于注解方式的配置文件注入，注入到IoC容器中
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(RegisterBeanFactoryConfig.class);
        IUserDao userDao = context.getBean("userDao", IUserDao.class);
        String res = userDao.queryUserInfo("100001");
        System.out.println("测试结果：" + res);
    }

}
